package com.cy.aircompressor.main.home.lifecycle.provider;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.NonNull;

import com.cy.aircompressor.databinding.ItemMaintenanceRecordDetailLayoutBinding;
import com.cy.aircompressor.entity.maintenance.MaintenanceRecordDetail;
import com.drug.lib.view.recycptr.ItemViewBinder;
import com.net.model.base.BaseBindViewHolder;

public class MaintenanceRecordDetailProvider extends ItemViewBinder<MaintenanceRecordDetail, MaintenanceRecordDetailProvider.ViewHolder> {
    Context mContext;

    public MaintenanceRecordDetailProvider(Context mContext) {
        this.mContext = mContext;
    }

    @NonNull
    @Override
    protected MaintenanceRecordDetailProvider.ViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        return new ViewHolder(ItemMaintenanceRecordDetailLayoutBinding.inflate(inflater, parent, false));

    }

    @Override
    protected void onBindViewHolder(@NonNull MaintenanceRecordDetailProvider.ViewHolder holder, @NonNull MaintenanceRecordDetail entity) {
        holder.mBinding.beforeName.setText(entity.getOldName());
        holder.mBinding.beforeSn.setText(entity.getOldSn());
        holder.mBinding.afterName.setText(entity.getNewName());
        holder.mBinding.afterSn.setText(entity.getNewSn());
    }


    public class ViewHolder extends BaseBindViewHolder<ItemMaintenanceRecordDetailLayoutBinding> {

        protected ViewHolder(ItemMaintenanceRecordDetailLayoutBinding itemView) {
            super(itemView);
        }
    }


}
